
// <copyright file="IDataSource.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   This interface defines a contract that who ever implements this interface acts as a DataSource.
//   It means the implemented class accepts an empty a dataTransferObject with the Key _properties set and populates the rest of the
//   _properties from the data source.
//   In general, a dataSource need not be a database. It can be anything. May be a file, a service proxy etc.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Data
{
    using System.Collections.Generic;

    /// <summary>
    /// This interface defines a contract that who ever implements this interface acts as a DataSource.
    ///     It means the implemented class accepts an empty a dataTransferObject with the Key _properties set and populates the rest of the
    ///     _properties from the data source.
    ///     In general, a dataSource need not be a database. It can be anything. May be a file, a service proxy etc.
    /// </summary>
    /// <typeparam name="T">
    /// </typeparam>
    public interface IDataSource<in T>
    {
        #region Public Methods and Operators

        /// <summary>
        /// Populates the specified dataTransferObjects.
        /// </summary>
        /// <param name="dataTransferObjects">
        /// The dataTransferObjects.
        /// </param>
        /// <param name="tag">
        /// The tag.
        /// </param>
        void Populate(IEnumerable<T> dataTransferObjects, object tag = null);

        #endregion Public Methods and Operators
    }
}
